/*******************************************************************************
  Name: complex.h
  Copyright: Kieran Foot 2009
  Author: Kieran Foot
  Date: 13/06/09 13:07
  Description: Defines the functionality for complex arithmatic
*******************************************************************************/

#include <_ansi.h>
#include <MGOS.h>

#ifndef __COMPLEX_H__
#define __COMPLEX_H__

_BEGIN_STD_C

// GCC Specific
//#if __GNUC_PREREQ(2, 97)
//    #define _Complex __complex__
//#endif

// Define macros for Complex and Imaginary number types
#define complex _Complex
#define _Complex_I const float _Complex

#if MGOS_SUPPORT_IMAGINARY == 1
    #define imaginary _Imaginary
    #define _Imaginary_I const float _Imaginary
    #define I _Imaginary_I
#else
    #define I _Complex_I
#endif

double cabs(double complex x);
float cabsf(float complex x);
long double cabsl(long double complex x);
double complex cacos(double complex x);
float complex cacosf(float complex x);
double complex cacosh(double complex x);
float complex cacoshf(float complex x);
long double complex cacoshl(long double complex x);
long double complex cacosl(long double complex x);
double carg(double complex x);
float cargf(float complex x);
long double cargl(long double complex x);
double complex casin(double complex x);
float complex casinf(float complex x);
double complex casinh(double complex x);
float complex casinhf(float complex x);
long double complex casinhl(long double complex x);
long double complex casinl(long double complex x);
double complex catan(double complex x);
float complex catanf(float complex x);
double complex catanh(double complex x);
float complex catanhf(float complex x);
long double complex catanhl(long double complex x);
long double complex catanl(long double complex x);
double complex ccos(double complex x);
float complex ccosf(float complex x);
double complex ccosh(double complex x);
float complex ccoshf(float complex x);
long double complex ccoshl(long double complex x);
long double complex ccosl(long double complex x);
double complex cexp(double complex x);
float complex cexpf(float complex x);
long double complex cexpl(long double complex x);
double cimag(double complex x);
float cimagf(float complex x);
long double cimagl(long double complex x);
double complex clog(double complex x);
float complex clogf(float complex x);
long double complex clogl(long double complex x);
double complex conj(double complex x);
float complex conjf(float complex x);
long double complex conjl(long double complex x);
double complex cpow(double complex x, double complex y);
float complex cpowf(float complex x, float complex y);
long double complex cpowl(long double complex x, long double complex y);
double complex cproj(double complex x);
float complex cprojf(float complex x);
long double complex cprojl(long double complex x);
double creal(double complex x);
float crealf(float complex x);
long double creall(long double complex x);
double complex csin(double complex x);
float complex csinf(float complex x);
double complex csinh(double complex x);
float complex csinhf(float complex x);
long double complex csinhl(long double complex x);
long double complex csinl(long double complex x);
double complex csqrt(double complex x);
float complex csqrtf(float complex x);
long double complex csqrtl(long double complex x);
double complex ctan(double complex x);
float complex ctanf(float complex x);
double complex ctanh(double complex x);
float complex ctanhf(float complex x);
long double complex ctanhl(long double complex x);
long double complex ctanl(long double complex x);

_END_STD_C

#endif
